import { type } from '../action'

const ebikeData = (state, action) => {
  switch (action.type) {
    case type.SWITCH_MENU:
      return {
        ...state,
        menuName: action.menuName
      };
    case type.USERINFO:
      return {
        ...state,
        userInfo: action.userInfo
      };
    case type.LOGOUT:
      return {
        ...state,
        userInfo: null
      }
    default:
      return { ...state };
  }
};

export default ebikeData;